/**
 * 
 */
package jnzb.model.event;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

/**
 * Represents a single event
 * 
 * @author AA1
 * 
 */
public class Event {

	private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
	private String description;
	private String time;
	private EventType type;

	public Event(String description, EventType type) {
		this.description=description;
		this.type=type;
		
		this.time=sdf.format(GregorianCalendar.getInstance().getTime());
		
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the time
	 */
	public String getTime() {
		return time;
	}

	/**
	 * @param time the time to set
	 */
	public void setTime(String time) {
		this.time = time;
	}

	/**
	 * @return the type
	 */
	public EventType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(EventType type) {
		this.type = type;
	}

	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append(this.time).append("\t");
		sb.append("[").append(this.type.name()).append ("]\t");
		sb.append(description);
		return sb.toString();
	}
}
